CC=g++
CFLAGS= -ggdb -Wall -Wno-deprecated
PPFLAGS=-Wall -I/usr/sww/include -L/usr/sww/lib -lpcap -lsocket -lnsl
LFLAGS=-lsocket -lnsl
OBJS=MNLClient.o
FRSRC=ServerConnection.cpp file_recv.cpp ReceiveWindow.cpp Packet.cpp
FSSRC=ClientConnection.cpp file_send.cpp Packet.cpp
PPSRC=froto_parser.cpp Packet.cpp

FROUT=file_recv
FSOUT=file_send
PPOUT=proto_parser

FRHDR=Packet.h ServerConnection.h ReceiveWindow.h stdGNUTDefs.h
FSHDR=Packet.h ClientConnection.h stdGNUTDefs.h
PPHDR=Packet.h

file_recv: $(FRSRC) $(FRHDR)
	$(CC) $(CFLAGS) $(LFLAGS) -o $(FROUT) $(OBJS) $^

file_send: $(FSSRC) $(FSHDR)
	$(CC) $(CFLAGS) $(LFLAGS) -o $(FSOUT) $(OBJS) $^

proto_parser: $(PPSRC) $(PPHDR)
	$(CC) $(PPSRC) $(PPFLAGS) -o $(PPOUT)

all:
	$(MAKE) clean
	$(MAKE) file_send
	$(MAKE) file_recv
	$(MAKE) proto_parser

clean:
	rm -f $(FSOUT) $(FROUT) $(PPOUT) *~
